package icu.twtool.ui.router

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import icu.twtool.ui.router.routes.exerciseManageRoute
import icu.twtool.ui.router.routes.practiceRecordManageRoute

/**
 * @author Wen
 * @since 2022-11-02
 */
class RouteState(
    items: List<Route>,
    active: Route
) {

    var items by mutableStateOf(items)

    var active by mutableStateOf(active)
}

@Composable
@Suppress("FunctionName")
fun rememberRouteState(): RouteState {
//    val active = Route("在线考试") {
//        Text("在线考试")
//    }
    val active = exerciseManageRoute
    val items = listOf(
        active,
        practiceRecordManageRoute
    )

    return RouteState(
        items,
        active
    )
}